<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp" %>
<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function jumpPage(page) {
	var searchForm = document.searchForm;
	searchForm.action = "<s:property value='contextPath'/>/pm/assign/edit.do?currentPage=" + page;
	searchForm.submit();
}

function editData(id) {
	var searchForm = document.searchForm;
	searchForm.action = "<s:property value='contextPath'/>/pm/assign/editShopDetail.do?currentPage=${currentPage}&entity.id="+id;
	searchForm.submit();
}

function areaConfirm(id) {
	if(confirm("确认要发布分配的绩效吗?")) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/pm/assign/areaConfirm.do?currentPage=${currentPage}&entity.id="+id;
		searchForm.submit();
	}	  
}
function holeSu(){
	window.location.href="<s:property value='contextPath'/>/pm/assign/index.do";
}
function releaseConfirm(id) {
	if(confirm("确认要发布分配的绩效吗?")) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/pm/assign/releaseConfirm.do?currentPage=${currentPage}&entity.id="+id;
		searchForm.submit();
	}	  
}
//-->
</script>
	<span style="color:red;" id="msg">
		 <s:actionerror/>
	</span>
    <div class="xt_main_right_center">
      <form name="searchForm" id="searchForm" method="post" action="edit.do">
      	<input type='hidden' name='parent.id' value='${parent.id}' />
		<input type='hidden' name='redirectUrl' value='<s:property value='redirectUrl'/>' />
      <table width="100%" border="0" cellpadding="0" cellspacing="0"  style="border-color:#CCCCCC;">
	        <tr>
	        	<td class="left-td-width-bg">
	   				  <span>店号:</span>
	            </td>
	            <td class="right-td-width-bg-left">
	             <input type="text" name='search.shop.shopMark' class="input" value="${search.shop.shopMark}"/>
	            </td>
	       
	          <td class="left-td-width-bg">
	   				  <span>店名:</span>
              </td>
	            <td class="right-td-width-bg-left">
	             <input type="text" name='search.shop.shopName' class="input" value="${search.shop.shopName}"/>
	            </td>
	            <td class="left-td-width-bg">
	            	区域
	            </td>
	            <td><input type="text" name="search.shop.area.name" value="${search.shop.area.name}" /></td>
	        </tr>
	        
		     <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
			    <td height="28" colspan="6" align="right" style="border-bottom:none;">
			    	<input type="button" class="btn_clear_form" onclick="clearForm(this.form);return false;"/>
			    	<input name="" type="submit" name="submit" value=""  class="btn_query"/>
			    </td>
		    </tr>
        </table>
      </form>
</div>
      
      <br/>	
     
     
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>实收店铺列表：</strong></font></td>
		    <td height="25" align="right">
		<s:if test="parent.status != null && @com.jysz.certificate.persistence.enums.PerformanceAssignStatus@NOT_CONFIRM.equals(parent.status)">
			<jysz:permission code="PM_ASSIGN_AREA_CONFIRM">
	 			<a href="javascript:areaConfirm(<s:property value="parent.id"/>)" title="区域经理确认">确认</a>
	 		</jysz:permission>
	 	</s:if>&nbsp;&nbsp;
<%-- 		  	  <a href="add.do"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a> --%>
            </td>
		  </tr>
</table>
		      
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
		  <tr>
    		        <td width="3%" class="top-td-width-bg">序号</td>
    		        <td width="14%" class="top-td-width-bg">4S店</td>
    		        <td width="12%" class="top-td-width-bg">所属区域</td>
				    <td width="12%" class="top-td-width-bg">区域经理</td>
			    	<td width="8%" class="top-td-width-bg">管理费金额</td>
				    <td width="8%" class="top-td-width-bg">驻店顾问绩效</td>
				    <td width="8%" class="top-td-width-bg">区域经理绩效</td>				    
			        <td width="5%" class="top-td-width-bg">操作</td>
		  </tr>
		  
 <s:iterator value="page.result" status="s">
	<tr> 
	  <td class="down-center-td-width-bg">${s.index+1}</td>
	  <td class="down-left-td-width-bg">
	 	 (<s:property value="shop.shopMark"/>)<s:property value="shop.shopName" />
	  </td>
	  <td class="down-left-td-width-bg">
	 	<s:property value="shop.area.name" />
	  </td>	  
	  <td class="down-center-td-width-bg">
	  <s:if test="areaUsers != null">
		  <s:property value="@com.jysz.webcore.utils.ReflectionUtils@convertElementPropertyToString(areaUsers,'realName',',')"/>
	  </s:if>
	  </td>
	  <td class="down-center-td-width-bg">
		   <s:property value="formatAmount(payinAmount)"/>
	  </td>
	  <td class="down-center-td-width-bg">
	  	<s:property value="formatAmount(totalAmount)"/>
	  </td>
	  <td class="down-center-td-width-bg">
	  	<s:property value="formatAmount(areaTotalAmount)"/>
	  </td>	  
	  <td class="down-center-td-width-bg">
	    <a href="javascript:editData(<s:property value="id"/>);"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
<%-- 	    <a href="javascript:deleteData(<s:property value="id"/>)"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a> --%>
	  </td>
	</tr>
</s:iterator>		  
		<tr>
		 <td height="36" colspan="10" class="down-center-td-width-bg" align="right">
			<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
 		</td>
		  </tr>
		</table>
<table width="100%" border="0">
          <tr>
            <td width="50%" align="right" >
              <input type="button" onclick="holeSu()" class="btn_temporary"  name="button" id="button" value="" />
	            <jysz:permission code="PM_ASSIGN_CONFIRM_ASSIGN">
				 	<s:if test="isCanAssign(parent)">
				 		<input type="button" onclick="releaseConfirm(${parent.id})" class="sure" name="button" id="button" value="" />
				 	</s:if>
		 		</jysz:permission>
            </td>
          </tr>
        </table>
